import request from '@/utils/request'

export const getAdminList = data => {
  return request({
    url: '/admin/getAdminList',
    method: 'post',
    data,
  })
}

export const getUserList = () => {
  return request({
    url: '/admin/getUserList',
    method: 'get',
  })
}

export const addAdmin = data => {
  return request({
    url: '/admin/add',
    method: 'post',
    data,
  })
}

export const delAdmin = aid => {
  return request({
    url: '/admin/del?id=' + aid,
    method: 'delete',
  })
}

export const getAdminDetail = aid => {
  return request({
    url: '/admin/edit?id=' + aid,
    method: 'get',
  })
}

export const editAdmin = data => {
  return request({
    url: '/admin/edit',
    method: 'put',
    data,
  })
}

export const editPassword = data => {
  return request({
    url: '/admin/editPassword',
    method: 'put',
    data,
  })
}